package com.ln.第二遍1027.demo001;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/10/27 16:58
 */
public class Test001 {
    public static void main(String[] args) throws Exception{
        Class catClass = Cat.class;

        Cat cat = new Cat();
        Class aClass = cat.getClass();

        Class aClass1 = Class.forName("com.ln.第二遍1027.demo001.Cat");

        System.out.println(catClass==aClass);
        System.out.println(catClass==aClass1);
        System.out.println(aClass1==aClass);

        Cat cat1 =(Cat) catClass.newInstance();
        Cat cat2 =(Cat) aClass.newInstance();
        Cat cat3 =(Cat) aClass1.newInstance();

        System.out.println(cat1==cat2);
        System.out.println(cat1==cat3);
        System.out.println(cat2==cat3);


    }
}
class Cat{

}
